@page "/simple"
@using BlazorDatasheet.Render
@using BlazorDatasheet.Core.Data
@using BlazorDatasheet.Core.Formats
@using BlazorDatasheet.Core.FormulaEngine

<PageTitle>Simple example</PageTitle>

<h1>Simple example</h1>

<p>Below is a sheet with 100,000 rows. There is no data validation or formatting and the default editors are used.</p>

<div style="overflow: scroll; width: 700px; height: 400px;">

    <Datasheet
        ShowColHeadings="true"
        ShowRowHeadings="true"
        Sheet="sheet"/>

</div>
<button @onclick="@(() => sheet.SetFormat(sheet.Selection.Regions, new CellFormat() { BackgroundColor = "red" }))">Set format to red</button>
<button @onclick="@(() => sheet.SetFormat(sheet.Selection.Regions, new CellFormat() { BackgroundColor = "blue" }))">Set format to blue</button>


@code{

    private Sheet sheet;

    protected override void OnInitialized()
    {
        sheet = new Sheet(numRows: 100000, numCols: 20000);
    }

}